package com.study.suanfa.digui;

/**
 * @description: JieCheng   n阶乘，使用递归实现
 * @date: 2020/12/1 19:57
 * @author: hcm
 * @version: 1.0
 */
public class JieCheng {

    public static void main(String[] args) {

        int n = 3;
        System.out.println(nJieCheng(n));
    }

    private static int nJieCheng(int n) {
        if(n ==1){
            return 1;
        }
        return n*(nJieCheng(n-1));
    }
}
